import request from '@/utils/request.js'

// 查询收藏夹列表
export function listCollect(query) {
    return request({
        url: '/app/collect/list',
        method: 'get',
        params: query
    })
}

// 新增收藏夹
export function addCollect(data) {
    return request({
        url: '/app/collect',
        method: 'post',
        data: data
    })
}

// 修改收藏夹
export function updateCollect(data) {
    return request({
        url: '/app/collect',
        method: 'put',
        data: data
    })
}

// 删除收藏夹
export function delCollect(collectId) {
    return request({
        url: '/app/collect/' + collectId,
        method: 'delete'
    })
}

// 根据收藏夹ID查询收藏夹
export function queryCollectById(roleId) {
    return request({
        url: '/app/collect/deptTree/' + roleId,
        method: 'get'
    })
}



// 查询文章列表
export function listArticle(query) {
    return request({
        url: '/app/article/list',
        method: 'get',
        params: query
    })
}

// 新增文章
export function addArticle(data) {
    return request({
        url: '/app/article',
        method: 'post',
        data: data
    })
}

// 修改文章
export function updateArticle(data) {
    return request({
        url: '/app/article',
        method: 'put',
        data: data
    })
}


// 删除文章
export function delArticle(articleId) {
    return request({
        url: '/app/article/' + articleId,
        method: 'delete'
    })
}

// 根据文章ID查询文章
export function queryArticleById(articleId) {
    return request({
        url: '/app/article/' + articleId,
        method: 'get'
    })
}
